USE [SpringSocial]
GO

/****** Object:  Table [dbo].[Player]    Script Date: 04/04/2012 16:19:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Player](
	[id] [int] NOT NULL,
	[firstName] [varchar](50) NULL,
	[middleName] [varchar](50) NULL,
	[lastName] [varchar](50) NULL,
	[nationality] [varchar](3) NULL,
	[dateOfBirth] [date] NULL,
	[countryOfBirth] [varchar](3) NULL,
	[height] [int] NULL,
	[weight] [int] NULL,
	[team] [int] NULL,
 CONSTRAINT [PK_Player] PRIMARY KEY CLUSTERED 
(
	[id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Player]  WITH CHECK ADD  CONSTRAINT [FK_Player_Country] FOREIGN KEY([countryOfBirth])
REFERENCES [dbo].[Country] ([code])
GO

ALTER TABLE [dbo].[Player] CHECK CONSTRAINT [FK_Player_Country]
GO

ALTER TABLE [dbo].[Player]  WITH CHECK ADD  CONSTRAINT [FK_Player_Country1] FOREIGN KEY([nationality])
REFERENCES [dbo].[Country] ([code])
GO

ALTER TABLE [dbo].[Player] CHECK CONSTRAINT [FK_Player_Country1]
GO

ALTER TABLE [dbo].[Player]  WITH CHECK ADD  CONSTRAINT [FK_Player_Team] FOREIGN KEY([team])
REFERENCES [dbo].[Team] ([id])
GO

ALTER TABLE [dbo].[Player] CHECK CONSTRAINT [FK_Player_Team]
GO


